package com.example.demo.util;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Data
@Document(indexName = "query")
public class EsQueryBean implements Serializable {
    @Id
    @Field(type = FieldType.Keyword, store = true)
    private String id;
    @Field(index = true, type = FieldType.Text, analyzer = "ik_max_word")
    private String content;
    /**
     * 身份证号
     */
    @Field(index = true, type = FieldType.Keyword)
    private String idCard;
    /**
     * 年龄
     */
    @Field(index = true, type = FieldType.Integer)
    private Integer age;
    /**
     * 性别
     */
    @Field(index = true, type = FieldType.Keyword)
    private String sex;
    /**
     * 姓名
     */
    @Field(index = true, type = FieldType.Text, analyzer = "ik_max_word")
    private String name;
}
